#include "redisconn.h"

RedisConn::~RedisConn()
{
    if (m_reply != nullptr)
        freeReplyObject(m_reply);
    redisFree(m_Conn);
}

bool RedisConn::connect(const char *ip, int port)
{
    m_Conn = redisConnect(ip, port);
    if (m_Conn == nullptr)
        return false;
    return true;
}

bool RedisConn::executeCommand(const char *command)
{
    m_reply = (redisReply *)redisCommand(m_Conn, command);
    if (m_reply == nullptr)
        return false;
    return true;
}